Pflasterung Gruppe M1, Typ2.
Basis ist ein Sechseck mit parallelen Seiten
Konstruktion siehe Script 2
============================================

ScriptBegin
var Grafik = "Script Turtle"

var a=8;              // Strecke AB 
    wb=130;           // Winkel AB,BC
    b=1.3*a;          // Strecke BC 
    wc=88;            // Winkel BC,CD
    c=1.8*a;          // Strecke CD
    
    x0=-80; y0=-110;  // PflasterAnfangspunkt
    RandC  ="black";
    RandW  =0.5;
    ShiftC ="green";
    Fill0  ="lightblue"
    Fill1  ="royalblue"
    Fill2  ="lightgreen";
    Fillp  ="red";

function init()
{ t.setBrush("black");
  t.setPage();  
  t.setAntiAliasing(); 
}


function draw()
{ t.drawKoordSystem();
  t.drawRaster();

  defBefehle();
  defSplines();
  defFliesen();
  drawPflaster();

  t.setPen(RandC); t.rahmen();
}



function defBefehle()
{ wd=720-wb-wc;
  t.setPen("black");
  
  t.beginPolygon(); t.setNoStyle();
  t.goTo(0,0);               t.defPoint("A"); 
  t.turnTo(0);    t.move(a); t.defPoint("B");
  t.turn(180-wb); t.move(b); t.defPoint("C");
  t.turn(180-wc); t.move(c); t.defPoint("D");
  t.turn(180-wd); t.move(a); t.defPoint("E");
  t.turn(180-wb); t.move(b); 
  t.endPolygon();
  t.setPen(); t.defDraw("Sechseck");

  t.setPen(RandC,RandW); 
  t.defLine("AB","A","B");
  t.defLine("BC","B","C");
  t.defLine("CD","C","D");

  t.setPen(ShiftC,0.3);
  t.defVector("Shift1","A","C");    
  t.defVector("Shift2","B","D");  
  t.defVector("Shift3","C","E");  
}



function defSplineAB()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(0,0);
 t.moveTo(8,-10);
 t.moveTo(9,3);
 t.moveTo(21,-7);
 t.moveTo(25,-5);
 t.moveTo(17,5);
 t.moveTo(25,10);
 t.moveTo(35,0);
 t.endPolygon(3);
 t.splinePolygon()
} 


function defSplineBC()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(30,0);
 t.moveTo(26,32);
 t.moveTo(55,15);
 t.moveTo(55.0687,29.8757);
 t.endPolygon(3);
 t.splinePolygon();
}

function defSplineCD()
{t.setNoStyle();
 t.beginPolygon();
 t.goTo(0,0);
 t.moveTo(8,-10);
 t.moveTo(9,3);
 t.moveTo(21,-7);
 t.moveTo(25,-5);
 t.moveTo(17,5);
 t.moveTo(25,10);
 t.moveTo(35,0);
 t.endPolygon(3);
 t.splinePolygon()
} 



function defSplines()
{ t.setPen(RandC,RandW); 
  
  t.setPolygon("AB"); t.endPolygon(3);
  defSplineAB(); t.defDraw("AB",3);

  t.setPolygon("BC"); t.endPolygon(3);
  defSplineBC(); t.defDraw("BC",3);

  t.setPolygon("CD"); t.endPolygon(3);
  defSplineCD(); t.defDraw("CD",3);
} 



function  defFliesen()
{ t.beginPolygon();
  t.setPolygon("AB",0);
  t.addPolygon("BC",0);
  t.addPolygon("CD",0);
  t.addPolygon("AB",-1);
  t.addPolygon("BC",-1);
  t.addPolygon("CD",-1);
  t.endPolygon();
  t.setPen(RandC,RandW,1);

  t.setBrush(Fill0); t.defDraw("Fliese0"); 
  t.setBrush(Fill1); t.defDraw("Fliese1");
  t.setBrush(Fill2); t.defDraw("Fliese2");

  t.goTo(-9,13); t.isoPolygon(-1);  
  t.setPen("",-1,0); t.setBrush(Fillp); t.defDraw("Fliese2",1);
}



function drawPflaster()
{
  t.goTo("Shift3");
  t.turnTo(180-t.getW());
  //t.turnTo(0);
  t.setPen(RandC); 
  t.setNoStyle(); 
 
  for(j=0; j<16; j++)
  { t.goTo(x0,y0);
    t.shift("Shift2",j);
  
    for(i=0; i<16; i++)
    { n=(i+j) % 3;   t.draw("Fliese"+n);
      t.shift("Shift3",-1);
    }    
  }
}


ScriptEnd#1

============================================
Konstruktion zu Script #1

============================================
ScriptBegin
var Grafik = "Script Turtle"

function init() //Initialisierungen
{ t.defScript("M22","./Pflaster02.txt");
  t.setPage(-60,45,7);
} 

function draw() //Zeichenbefehle
{ //t.drawKoordSystem(); t.drawRaster();
  Konstruktion();
}


function Konstruktion()
{ t.msgDraw(); t.goTo(0,0); t.turnTo(0);
 t.setIdentity();

  t.setPen("black",0); t.setBrush("gray",1,100);
  t.draw("Fliese1",false);
  
  t.setBrush("yellow",1,60);
  t.draw("Sechseck",false);
  t.draw("A"); t.draw("B"); t.draw("C");
  t.draw("D"); t.draw("E");

  t.setPen("red",  0.5); t.draw("AB",false);
  t.setPen("blue", 0.5); t.draw("BC",false);
  t.setPen("green",0.5); t.draw("CD",false);
  
  t.setPen("green",0,1);
  t.goTo(0,0); t.draw("Shift1"); t.moveTo("Shift1");
  t.goTo(0,0); t.draw("Shift2"); t.moveTo("Shift2");
  t.goTo(0,0); t.draw("Shift3"); t.moveTo("Shift3");

  t.setBrush("lightblue",1,100);
  t.draw("Fliese0",false);
 
  t.setPen("black",0,1); t.setFont("",1.2);
  t.goTo(0,0);
  t.drawName("Shift1",2,-2.2);
  t.drawName("Shift2",-8,-1);
  t.drawName("Shift3",-8,-1.2);

  t.drawName("A",-1.1,-2.2);
  t.drawName("B",0,-2.2);
  t.drawName("C",2,0.5);
  t.drawName("D",1,0.5);
  t.drawName("E",1,0.5);

  t.text(-40,-3,40,-20,
"Pflasterung Gruppe M2 Typ3\n\
Frei gewhlt: Sechseck und die Kurven rot, blau, grn\n\
");

}

ScriptEnd#2

